package com.lanchetech.dao;
import java.util.Collection;
import org.apache.ibatis.annotations.Param;
import java.util.List;

import com.lanchetech.entity.InviteFirstBuy;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface InviteFirstBuyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(InviteFirstBuy record);

    int insertSelective(InviteFirstBuy record);

    InviteFirstBuy selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(InviteFirstBuy record);

    int updateByPrimaryKey(InviteFirstBuy record);

    List<InviteFirstBuy> findAllBySuperiorIdAndStatusLimit3(@Param("superiorId")Long superiorId,@Param("status")Byte status);

    int updateStatusAndRewardQueueIdByIdIn(@Param("updatedStatus")Byte updatedStatus,@Param("updatedRewardQueueId")Long updatedRewardQueueId,@Param("idCollection")Collection<Long> idCollection);

    InviteFirstBuy findOneByOrderSkuId(@Param("orderSkuId")Long orderSkuId);


    int updateStatusByRewardQueueIdAndStatus(@Param("updatedStatus")Byte updatedStatus,@Param("rewardQueueId")Long rewardQueueId,@Param("status")Byte status);


    int updateStatusByRewardQueueIdAndOrderSkuId(@Param("updatedStatus")Byte updatedStatus,@Param("rewardQueueId")Long rewardQueueId,@Param("orderSkuId")Long orderSkuId);

    Long countBySuperiorIdAndStatus(@Param("superiorId")Long superiorId,@Param("status")Byte status);
}